<%@ page import="union.Contrato" %>

<h3>Dados de contrato</h3>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'acompanhamentos', 'error')} ">
	<label for="acompanhamentos">
		<g:message code="contrato.acompanhamentos.label" default="Acompanhamentos" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contratoInstance?.acompanhamentos?}" var="a">
    <li><g:link controller="acompanhamento" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="acompanhamento" action="create" params="['contrato.id': contratoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'acompanhamento.label', default: 'Acompanhamento')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'avaliacao', 'error')} required">
	<label for="avaliacao">
		<g:message code="contrato.avaliacao.label" default="Avaliacao" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="avaliacao" name="avaliacao.id" from="${union.Avaliacao.list()}" optionKey="id" required="" value="${contratoInstance?.avaliacao?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'avaliado', 'error')} required">
	<label for="avaliado">
		<g:message code="contrato.avaliado.label" default="Avaliado" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="avaliado" name="avaliado.id" from="${union.Colaborador.list()}" optionKey="id" required="" value="${contratoInstance?.avaliado?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'competenciasContrato', 'error')} ">
	<label for="competenciasContrato">
		<g:message code="contrato.competenciasContrato.label" default="Competencias Contrato" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contratoInstance?.competenciasContrato?}" var="c">
    <li><g:link controller="competenciasContrato" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="competenciasContrato" action="create" params="['contrato.id': contratoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'competenciasContrato.label', default: 'CompetenciasContrato')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'data', 'error')} required">
	<label for="data">
		<g:message code="contrato.data.label" default="Data" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="data" precision="day"  value="${contratoInstance?.data}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'gestor', 'error')} required">
	<label for="gestor">
		<g:message code="contrato.gestor.label" default="Gestor" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="gestor" name="gestor.id" from="${union.Colaborador.list()}" optionKey="id" required="" value="${contratoInstance?.gestor?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contratoInstance, field: 'indicadorResultadoContrato', 'error')} ">
	<label for="indicadorResultadoContrato">
		<g:message code="contrato.indicadorResultadoContrato.label" default="Indicador Resultado Contrato" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contratoInstance?.indicadorResultadoContrato?}" var="i">
    <li><g:link controller="indicadorResultadoContrato" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="indicadorResultadoContrato" action="create" params="['contrato.id': contratoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'indicadorResultadoContrato.label', default: 'IndicadorResultadoContrato')])}</g:link>
</li>
</ul>

</div>

